/* Copyright (c) 2004-2024 peigen.info. All rights reserved. */

package info.peigen.hotpot.manage.core.util.convertor;

import info.peigen.hotpot.manage.core.domain.Position;
import info.peigen.hotpot.manage.core.repository.entity.PositionEntity;
import info.peigen.hotpot.manage.core.service.order.PositionCreateOrder;
import info.peigen.hotpot.manage.core.service.order.PositionEditOrder;
import info.peigen.hotpot.manage.core.service.result.info.PositionInfo;
import org.mapstruct.Builder;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * <b>(PositionConvertor)</b>
 * "职位" 转换器
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2024-06-28
 */
@SuppressWarnings("unused")
@Mapper(builder = @Builder(disableBuilder = true))
public interface PositionConvertor {
    PositionConvertor INSTANCE = Mappers.getMapper(PositionConvertor.class);

    // ConvertToEntity
    PositionEntity convertToEntity(Position domain);
    List<PositionEntity> convertToEntitiesByDomain(List<Position> domains);

    PositionEntity convertToEntity(PositionInfo positionInfo);
    List<PositionEntity> convertToEntitiesByInfo(List<PositionInfo> positionInfo);

    // ConvertToDomain
    Position convertToDomain(PositionEntity entity);
    List<Position> convertToDomainsByEntity(List<PositionEntity> entities);
    Position convertToDomain(PositionInfo positionInfo);
    List<Position> convertToDomainsByInfo(List<PositionInfo> infos);

    Position convertToDomain(PositionCreateOrder order);
    Position convertToDomain(PositionEditOrder order);

    // ConvertToInfo
    PositionInfo convertToInfo(Position domain);
    List<PositionInfo> convertToInfosByDomain(List<Position> domains);

    PositionInfo convertToInfo(PositionEntity entity);
    List<PositionInfo> convertToInfosByEntity(List<PositionEntity> entities);
}